//
//  SkuCellSelectModel.m
//  sensen_ios
//
//  Created by pro on 16/3/9.
//  Copyright © 2016年 pro. All rights reserved.
//

#import "SkuCellSelectModel.h"

@implementation SkuCellSelectModel

- (instancetype)init {
    self = [super init];
    if (self) {
        _selectRow = -1;
        _selectSection = -1;
    }
    return self;
}

- (NSMutableArray *)isableTouchCollectArray {
    if (_isableTouchCollectArray == nil) {
        _isableTouchCollectArray = [[NSMutableArray alloc] initWithCapacity:0];
    }
    return _isableTouchCollectArray;
}

- (void)setRowCount:(NSInteger)rowCount {
    
    _rowCount = rowCount;
    
    [self.isableTouchCollectArray removeAllObjects];
    
    // 初始化能否点击数组为yes
    for (NSInteger i = 0; i < rowCount; i ++) {
        [self.isableTouchCollectArray addObject:@YES];
    }
}

// 改变状态
- (void)changeStateOfTouchCollectArray:(BOOL)state {
    
    for (int i = 0; i < self.isableTouchCollectArray.count; i ++) {
        [self.isableTouchCollectArray replaceObjectAtIndex:i withObject:@(state)];
    }
}

- (void)reloadSelectRow:(NSInteger)row section:(NSInteger)section {
    
    // 改变选中的组和行
    _selectRow = row;
    _selectSection = section;
}
@end
